<?php
function __autoload($classname){require(ROOT_DIR."/core/wizard/".$classname.".class.php");}
/**
 * Wizard
 * 
 * @package yarland.ru SVN localhost
 * @author gogogo
 * @copyright 2009
 * @version $Id$
 * @access public
 */
class Wizard
{
	var $db;
	var $table = '';
	var $pfx = '';
	var $pid = 'obj_id';
	/**
	 * Wizard::__construct()
	 * 
	 * @param MyDB $db
	 * @param string $tablename
	 * @param string $pfx
	 * @param string $id
	 * @return void
	 */
	function __construct(MyDB $db,$tablename = '',$pfx = '',$id = '')
	{
		$this->db = $db;
		if(strlen($tablename) > 0){$this->table = mysql_real_escape_string($tablename);}
		if(strlen($pfx) > 0){$this->pfx = mysql_real_escape_string($pfx);}
		if(strlen($id) > 0){$this->pid = $id;}
	}
	/**
	 * Wizard::getItem()
	 * 
	 * @param integer $id
	 * @return array || false on error
	 */
	function getItem($id = 0)
	{
		$item = array();
		if(intval($id) != 0)
		{
			$item = $this->db->fetch_one("SELECT * FROM $this->table WHERE id = '".mysql_real_escape_string($id)."'");
			if(!empty($item)) return $item;
			else return false;
		}
		else return false;
	}
}
?>